package yj.scms.goods.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import yj.scms.goods.feignapi.FeignUserService;
import yj.scms.userserviceapi.pojo.UserEntity;

@RestController
@RequestMapping("fua")
public class FeignUserAction {
    @Autowired
    private FeignUserService feignUserService;

    @RequestMapping(value = "/get/{id}",method = RequestMethod.GET)
    public UserEntity get(@PathVariable("id") long id){
        UserEntity userEntity = feignUserService.get(id);
        return userEntity;
    }

    @RequestMapping(value = "/add",method = RequestMethod.POST)
    public Integer addUser(@RequestBody UserEntity user){
        Integer id = feignUserService.addUser(user);
        return  id;
    }
}
